package com.gamerent.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gamerent.entity.GameAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 游戏账号Mapper接口
 */
@Mapper
public interface GameAccountMapper extends BaseMapper<GameAccount> {

    /**
     * 分页查询游戏账号
     */
    IPage<GameAccount> selectPageWithCondition(Page<GameAccount> page,
            @Param("gameName") String gameName,
            @Param("categoryId") Long categoryId,
            @Param("status") Integer status);

    /**
     * 查询热门游戏账号
     */
    List<GameAccount> selectHotAccounts(@Param("limit") Integer limit);

    /**
     * 搜索游戏账号
     */
    IPage<GameAccount> searchAccounts(Page<GameAccount> page,
            @Param("keyword") String keyword,
            @Param("gameName") String gameName,
            @Param("categoryId") Long categoryId,
            @Param("minPrice") Double minPrice,
            @Param("maxPrice") Double maxPrice);
}